﻿using System.IO;

namespace TroubleshootingofBeanBagAssistant.lCheck
{
	public class DesktopShortcutMethodCheck : IDiagnosticCheck
	{
		public string Name => "检查桌面快捷方式";

		public CheckResult Run()
		{
			string shortcutName = "AIMouse";
			string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
			string shortcutPath = Path.Combine(desktopPath, shortcutName + ".lnk");
			string exePath = @"C:\Users\Administrator\AppData\Local\Programs\BeanBagAIBrowserEdge\Applications\AIMouse.exe";

			if (!File.Exists(shortcutPath))
			{
				// 创建快捷方式
				MainWindow.CreateShortcutOnDesktop(shortcutName, exePath);
				return new CheckResult
				{
					Title = "未找到AIMouse桌面快捷方式",
					Detail = "已自动创建快捷方式"
				};
			}
			else
			{
				return new CheckResult
				{
					Title = "已检测到AIMouse桌面快捷方式",
					Detail = "无需处理"
				};
			}
		}
	}
}
